//
//  WCAURLRequestSerialization.h
//  WeChatAssistant
//
//  Created by Guo Rui on 2017/11/23.
//  Copyright © 2017年 GR Harry. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol WCAURLRequestSerialization <NSObject>

- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request
                                        withParameters:(id)parameters
                                                 error:(NSError *__autoreleasing *)error;

@end

@interface WCAHTTPRequestSerializer : NSObject<WCAURLRequestSerialization>

+ (instancetype)serializer;
- (void)setValue:(NSString *)value forHTTPHeaderField:(NSString *)field;

- (NSMutableURLRequest *)requestWithMethod:(NSString *)method
                                 URLString:(NSString *)URLString
                                parameters:(id)parameters
                                     error:(NSError * __autoreleasing *)error;


@property (nonatomic, assign) NSTimeInterval timeoutInterval;
@property (readonly, nonatomic, strong) NSDictionary <NSString *, NSString *> *HTTPRequestHeaders;

@end

@interface WCAJSONRequestSerializer : WCAHTTPRequestSerializer<WCAURLRequestSerialization>

@end

@interface WCATextRequestSerializer : WCAHTTPRequestSerializer<WCAURLRequestSerialization>

@end

